﻿using System.Linq;
using AB.ServiceDirectory.Commons.DataFilters;
using AB.ServiceDirectory.Dao;
using AB.ServiceDirectory.Entities;

namespace AB.ServiceDirectory.BO
{
    public sealed class TrustDistrictsBO
    {
        private static readonly TrustDistrictsDao Dao = new TrustDistrictsDao();

        private TrustDistrictsBO()
        {
        }

        public static IQueryable<TrustDistrict> GetTrustDistrict(TrustDistrictFilter filter, string sortType,
                                                                 int startRowIndex, int maxRows)
        {
            return Dao.GetList(filter, sortType, startRowIndex, maxRows);
        }

        public static TrustDistrict GetTrustDistrictsId(int id)
        {
            return Dao.GetTrustDistrictsId(id);
        }

        public static int GetTrustDistrictCount(TrustDistrictFilter filter)
        {
            return Dao.GetListCount(filter);
        }

        public static bool InsertTrustDistrict(TrustDistrict trustDistrict)
        {
            return Dao.AddTrustDistrict(trustDistrict);
        }

        public static bool EditTrustDistrict(TrustDistrict trustDistrict)
        {
            return Dao.EditTrustDistricts(trustDistrict);
        }

        public static bool SetTrustDistrictStatus(int trustDistrictId, bool status)
        {
            return Dao.SetTrustDistrictStatus(trustDistrictId, status);
        }

        public static bool CheckTrustDistrictName(string name)
        {
            return Dao.CheckTrustDistrictName(name);
        }
    }
}